package com.yc.sole.framework.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author yizuomin
 * @date 2023/3/9 18:04
 **/
@Data
@ConfigurationProperties(prefix = "yc.thread")
public class ThreadConfigProperties {

    /**
     * 线程名前缀
     */
    private String threadNamePrefix = "yc-task-";
    /**
     * 核心线程数量
     */
    private Integer corePoolSize = Runtime.getRuntime().availableProcessors();
    /**
     * 最大线程数
     */
    private Integer maxPoolSize = corePoolSize * 2;
    /**
     * 是否允许核心线程超时
     */
    private Boolean allowCoreThreadTimeOut = false;
    /**
     * 线程存活时间
     */
    private Integer keepAliveSeconds = 120;
    /**
     * 线程队列大小
     */
    private Integer queueCapacity = 100000;
}
